﻿$(document).ready(function(e) {
	/*此处有两种选择，如果是管理员用户登录则可以触发*/
	var preNickName="";
	var preClickTime="";
	var username = $('#lblCurrentUser').text();
    $('a[id^=MainContent_grvInfo_linkNickName][href]').click(function (e) {
		var urlNick=$(this).attr("href");
		var nickname=urlNick.split('&')[1].split('=')[1];
		if(preNickName!=nickname)
		{
			$.get("user.ashx",{username:username,nickname:nickname,ran:Math.random()},function(data){
				//alert(preClickTime);
			});
			preNickName=nickname;
			preClickTime=new Date().valueOf();  //前次点击的时间
		}
		else 
		{
			var nowTime=new Date().valueOf();
			var diffTime=new Date().valueOf()-preClickTime;
			if(diffTime>60000)
			{
				$.get("user.ashx",{username:username,nickname:nickname,ran:Math.random()},function(data){
					alert(preClickTime);
				});
			}
			preNickName=nickname;
			preClickTime=new Date().valueOf();
		}
    });
});